﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="Locations">
    <div id="MetroWeatherForcast" class="{@DisplayType}">
      <xsl:apply-templates select="Location"/>
    </div>
    <div id="poweredby">
      Powered by <a href="http://www.worldweatheronline.com/" title="Free local weather content provider" target="_blank">World Weather Online</a>
    </div>
  </xsl:template>

  <xsl:template match="Location">
    <div class='location {Colour}'>
      <div class='prev'>&lt;</div>
      <div class='rb-today'>
        <span class='today-city'>
          <xsl:value-of select="Name"/>
        </span>
        <span class='today-weather climacon {WeatherCode}'></span>
        <span class='today-temp'>
          <xsl:value-of select="CurrentTemp" disable-output-escaping="yes"/>
        </span>
        <span class='today-max-temp'>
          <xsl:value-of select="CurrentMaxTemp" disable-output-escaping="yes"/>
        </span>
        <span class='today-min-temp'>
          <xsl:value-of select="CurrentMinTemp" disable-output-escaping="yes"/>
        </span>
        <div class='week-wind-direction windrose-icon-40 wind-direction-{WindDirection}'>
          <span class='today-wind-speed'>
            <xsl:value-of select="WindSpeed"/>
          </span>
        </div>
      </div>
      <ul class='rb-week'>
        <xsl:apply-templates select="Forcast/DayOfWeek"/>
      </ul>
      <div class='next'>&gt;</div>
    </div>


  </xsl:template>


  <xsl:template match="Forcast/DayOfWeek">
    <!-- BEGIN .content-box -->

    <li class='rb-day'>
      <span class='week-day'>
        <xsl:value-of select="Day"/>
      </span>
      <span class='week-weather climacon {WeatherCode}'></span>
      <span class='week-temp'>
        <xsl:value-of select="MaxTemp" disable-output-escaping="yes"/>
      </span>
      <div class='week-wind-direction windrose-icon-40 wind-direction-{WindDirection}'>
        <span class='week-wind-speed'>
          <xsl:value-of select="WindSpeed"/>
        </span>
      </div>
    </li>
  </xsl:template>

</xsl:stylesheet>
